package 进阶.序列化;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class demo01_Objoutput {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream("d:/a.txt"));

        objectOutputStream.writeObject(new Person("jack",18));
        objectOutputStream.writeObject(new Person("luffy",19));
        objectOutputStream.writeObject(new Person("zero",20));

        /*
        * 因为存储的时二进制，不能直接打开看*/
        objectOutputStream.close();

    }

}
